package com.xcx.eduservice.client;

import com.xcx.commonuntils.returnuntls.ErrorEnum;
import com.xcx.commonuntils.returnuntls.ReturnMessage;
import com.xcx.commonuntils.returnuntls.ReturnMessageUtils;
import com.xcx.eduservice.entity.feignentity.FileSystem;
import com.xcx.eduservice.request.feignrequest.GetUserFilesRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;
/**
 * 熔断方法
 *
 * */
@Component
public class MinioFileDegradeFeignClient implements MinioFengClient{
    @Override
    public ReturnMessage<Object> upload(MultipartFile file) {
        //可以写返回错误信息，一旦远程调用出错会返回改响应
        return ReturnMessageUtils.errorWithEum(ErrorEnum.E_FEIGN_RESUME);
    }

    @Override
    public ReturnMessage<List<FileSystem>> getUserFiles(GetUserFilesRequest request) {
        return ReturnMessageUtils.errorWithEum(ErrorEnum.E_FEIGN_USERFILES);
    }
}
